Skip to content

Container hash tags propagation #9282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ygree
Copy link
Contributor

@ygree ygree commented Jul 30, 2025

What Does This Do

  • [DSM] Populate the base hash with the container tag hash if the process tag propagation feature flag is on.
  • [DSM] Inject the base hash into the pathway context?
  • [DBM] Refactor getBaseHash to make it visible in the DBM
  • [DBM] Inject the base hash into the SQL comment when the service mode is enabled.
    • fix SQLCommenterTest
    • add DB_DBM_INJECT_SERVICE_HASH_ENABLED
  • [DSM] hashOfKnownTags initialized once, and may not have ContainerTagsHash included, since it’s received from the Agent as a response header.
    It has to be updated every time ContainerTagsHash has been obtained.
  • Fix a couple of bugs spotted in SQLCommenter and remove unnecessary code.

Motivation

Backpropagation of container tags. The agent calculates the hash, which is then injected into DBM queries and the DSM pathway context.

Additional Notes

The agent sends the containerTagsHash in the response header. The Java Tracer stores it in the ContainerInfo.

Contributor Checklist

Jira ticket: AIDM-700

@ygree ygree self-assigned this Jul 30, 2025
@ygree ygree added comp: data streams Data Streams Monitoring comp: database Database Monitoring labels Jul 30, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jul 30, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1755523005 1755539190
git_commit_sha e125ff7 f9bf045
release_version 1.53.0-SNAPSHOT~e125ff7b82 1.52.0-SNAPSHOT~f9bf0459de
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1755541063 1755541063
ci_job_id 1085273317 1085273317
ci_pipeline_id 74002701 74002701
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-cx858s9s 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-cx858s9s 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 13 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.047 s) : 0, 1047328
Total [baseline] (10.651 s) : 0, 10650612
Agent [candidate] (1.055 s) : 0, 1055488
Total [candidate] (10.54 s) : 0, 10539555
section appsec
Agent [baseline] (1.22 s) : 0, 1220175
Total [baseline] (10.732 s) : 0, 10731632
Agent [candidate] (1.224 s) : 0, 1223636
Total [candidate] (10.697 s) : 0, 10696575
section iast
Agent [baseline] (1.179 s) : 0, 1178809
Total [baseline] (10.933 s) : 0, 10932857
Agent [candidate] (1.178 s) : 0, 1177833
Total [candidate] (10.809 s) : 0, 10808976
section profiling
Agent [baseline] (1.203 s) : 0, 1202865
Total [baseline] (10.923 s) : 0, 10923491
Agent [candidate] (1.194 s) : 0, 1194257
Total [candidate] (10.804 s) : 0, 10804171
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.047 s -
Agent appsec 1.22 s 172.847 ms (16.5%)
Agent iast 1.179 s 131.481 ms (12.6%)
Agent profiling 1.203 s 155.536 ms (14.9%)
Total tracing 10.651 s -
Total appsec 10.732 s 81.02 ms (0.8%)
Total iast 10.933 s 282.245 ms (2.7%)
Total profiling 10.923 s 272.88 ms (2.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.055 s -
Agent appsec 1.224 s 168.148 ms (15.9%)
Agent iast 1.178 s 122.345 ms (11.6%)
Agent profiling 1.194 s 138.77 ms (13.1%)
Total tracing 10.54 s -
Total appsec 10.697 s 157.02 ms (1.5%)
Total iast 10.809 s 269.421 ms (2.6%)
Total profiling 10.804 s 264.616 ms (2.5%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.451 ms) : 0, 1451
BytebuddyAgent [baseline] (732.068 ms) : 0, 732068
BytebuddyAgent [candidate] (738.388 ms) : 0, 738388
GlobalTracer [baseline] (242.391 ms) : 0, 242391
GlobalTracer [candidate] (243.461 ms) : 0, 243461
AppSec [baseline] (30.076 ms) : 0, 30076
AppSec [candidate] (30.357 ms) : 0, 30357
Debugger [baseline] (6.05 ms) : 0, 6050
Debugger [candidate] (6.074 ms) : 0, 6074
Remote Config [baseline] (666.324 µs) : 0, 666
Remote Config [candidate] (674.548 µs) : 0, 675
Telemetry [baseline] (13.641 ms) : 0, 13641
Telemetry [candidate] (13.909 ms) : 0, 13909
section appsec
crashtracking [baseline] (1.439 ms) : 0, 1439
crashtracking [candidate] (1.441 ms) : 0, 1441
BytebuddyAgent [baseline] (753.312 ms) : 0, 753312
BytebuddyAgent [candidate] (755.613 ms) : 0, 755613
GlobalTracer [baseline] (234.899 ms) : 0, 234899
GlobalTracer [candidate] (235.36 ms) : 0, 235360
IAST [baseline] (23.759 ms) : 0, 23759
IAST [candidate] (23.723 ms) : 0, 23723
AppSec [baseline] (169.362 ms) : 0, 169362
AppSec [candidate] (167.893 ms) : 0, 167893
Debugger [baseline] (6.566 ms) : 0, 6566
Debugger [candidate] (9.537 ms) : 0, 9537
Remote Config [baseline] (645.682 µs) : 0, 646
Remote Config [candidate] (622.138 µs) : 0, 622
Telemetry [baseline] (9.173 ms) : 0, 9173
Telemetry [candidate] (8.437 ms) : 0, 8437
section iast
crashtracking [baseline] (1.448 ms) : 0, 1448
crashtracking [candidate] (1.442 ms) : 0, 1442
BytebuddyAgent [baseline] (851.194 ms) : 0, 851194
BytebuddyAgent [candidate] (849.338 ms) : 0, 849338
GlobalTracer [baseline] (232.999 ms) : 0, 232999
GlobalTracer [candidate] (235.716 ms) : 0, 235716
IAST [baseline] (30.937 ms) : 0, 30937
IAST [candidate] (28.322 ms) : 0, 28322
AppSec [baseline] (26.513 ms) : 0, 26513
AppSec [candidate] (26.68 ms) : 0, 26680
Debugger [baseline] (5.769 ms) : 0, 5769
Debugger [candidate] (6.507 ms) : 0, 6507
Remote Config [baseline] (610.34 µs) : 0, 610
Remote Config [candidate] (597.628 µs) : 0, 598
Telemetry [baseline] (8.327 ms) : 0, 8327
Telemetry [candidate] (8.207 ms) : 0, 8207
section profiling
crashtracking [baseline] (1.442 ms) : 0, 1442
crashtracking [candidate] (1.41 ms) : 0, 1410
BytebuddyAgent [baseline] (767.012 ms) : 0, 767012
BytebuddyAgent [candidate] (761.923 ms) : 0, 761923
GlobalTracer [baseline] (223.138 ms) : 0, 223138
GlobalTracer [candidate] (220.592 ms) : 0, 220592
AppSec [baseline] (30.214 ms) : 0, 30214
AppSec [candidate] (30.077 ms) : 0, 30077
Debugger [baseline] (6.322 ms) : 0, 6322
Debugger [candidate] (6.24 ms) : 0, 6240
Remote Config [baseline] (717.958 µs) : 0, 718
Remote Config [candidate] (702.949 µs) : 0, 703
Telemetry [baseline] (15.483 ms) : 0, 15483
Telemetry [candidate] (16.077 ms) : 0, 16077
ProfilingAgent [baseline] (108.771 ms) : 0, 108771
ProfilingAgent [candidate] (107.672 ms) : 0, 107672
Profiling [baseline] (109.414 ms) : 0, 109414
Profiling [candidate] (108.328 ms) : 0, 108328
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047693
Total [baseline] (8.605 s) : 0, 8605271
Agent [candidate] (1.047 s) : 0, 1047195
Total [candidate] (8.54 s) : 0, 8539803
section iast
Agent [baseline] (1.178 s) : 0, 1177877
Total [baseline] (9.293 s) : 0, 9293045
Agent [candidate] (1.186 s) : 0, 1185747
Total [candidate] (9.279 s) : 0, 9278663
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent iast 1.178 s 130.184 ms (12.4%)
Total tracing 8.605 s -
Total iast 9.293 s 687.774 ms (8.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.047 s -
Agent iast 1.186 s 138.552 ms (13.2%)
Total tracing 8.54 s -
Total iast 9.279 s 738.86 ms (8.7%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.455 ms) : 0, 1455
crashtracking [candidate] (1.453 ms) : 0, 1453
BytebuddyAgent [baseline] (734.138 ms) : 0, 734138
BytebuddyAgent [candidate] (733.106 ms) : 0, 733106
GlobalTracer [baseline] (242.005 ms) : 0, 242005
GlobalTracer [candidate] (241.873 ms) : 0, 241873
AppSec [baseline] (30.244 ms) : 0, 30244
AppSec [candidate] (30.146 ms) : 0, 30146
Debugger [baseline] (6.029 ms) : 0, 6029
Debugger [candidate] (6.054 ms) : 0, 6054
Remote Config [baseline] (670.464 µs) : 0, 670
Remote Config [candidate] (669.563 µs) : 0, 670
Telemetry [baseline] (12.135 ms) : 0, 12135
Telemetry [candidate] (12.932 ms) : 0, 12932
section iast
crashtracking [baseline] (1.452 ms) : 0, 1452
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (849.671 ms) : 0, 849671
BytebuddyAgent [candidate] (857.218 ms) : 0, 857218
GlobalTracer [baseline] (232.969 ms) : 0, 232969
GlobalTracer [candidate] (233.209 ms) : 0, 233209
AppSec [baseline] (26.086 ms) : 0, 26086
AppSec [candidate] (27.652 ms) : 0, 27652
Debugger [baseline] (8.397 ms) : 0, 8397
Debugger [candidate] (6.615 ms) : 0, 6615
Remote Config [baseline] (596.194 µs) : 0, 596
Remote Config [candidate] (608.969 µs) : 0, 609
Telemetry [baseline] (8.326 ms) : 0, 8326
Telemetry [candidate] (8.393 ms) : 0, 8393
IAST [baseline] (29.4 ms) : 0, 29400
IAST [candidate] (29.523 ms) : 0, 29523
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1755523005 1755539190
git_commit_sha e125ff7 f9bf045
release_version 1.53.0-SNAPSHOT~e125ff7b82 1.52.0-SNAPSHOT~f9bf0459de
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1755540735 1755540735
ci_job_id 1085273318 1085273318
ci_pipeline_id 74002701 74002701
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-p92g485q 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-p92g485q 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 7 performance improvements and 0 performance regressions! Performance is the same for 5 metrics, 12 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:insecure-bank:iast_GLOBAL:high_load better
[-1.415ms; -1.042ms] or [-13.377%; -9.856%]
unstable
[+0.472op/s; +113.903op/s] or [+0.107%; +25.916%]
9.348ms 496.688op/s 10.576ms 439.500op/s
scenario:load:insecure-bank:tracing:high_load better
[-410.555µs; -187.001µs] or [-5.443%; -2.479%]
unstable
[-55.628op/s; +106.065op/s] or [-9.060%; +17.275%]
7.245ms 639.188op/s 7.543ms 613.969op/s
scenario:load:insecure-bank:profiling:high_load better
[-702.288µs; -428.246µs] or [-8.379%; -5.110%]
unstable
[-34.949op/s; +113.699op/s] or [-6.316%; +20.549%]
7.816ms 592.688op/s 8.381ms 553.312op/s
scenario:load:insecure-bank:iast:high_load better
[-641.926µs; -298.424µs] or [-6.656%; -3.094%]
unstable
[-36.994op/s; +85.931op/s] or [-7.683%; +17.847%]
9.174ms 505.969op/s 9.645ms 481.500op/s
scenario:load:petclinic:tracing:high_load better
[-2.917ms; -2.117ms] or [-6.540%; -4.747%]
unstable
[-1.856op/s; +14.356op/s] or [-1.770%; +13.687%]
42.089ms 111.138op/s 44.606ms 104.888op/s
scenario:load:petclinic:appsec:high_load better
[-2.750ms; -1.829ms] or [-5.641%; -3.751%]
unstable
[-1.146op/s; +13.197op/s] or [-1.194%; +13.747%]
46.467ms 102.025op/s 48.757ms 96.000op/s
scenario:load:petclinic:no_agent:high_load better
[-1.835ms; -1.218ms] or [-4.925%; -3.270%]
unstable
[-1.481op/s; +15.569op/s] or [-1.181%; +12.408%]
35.734ms 132.519op/s 37.261ms 125.475op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.367 ms) : 4318, 4416
.   : milestone, 4367,
iast (9.645 ms) : 9483, 9807
.   : milestone, 9645,
iast_FULL (13.795 ms) : 13519, 14071
.   : milestone, 13795,
iast_GLOBAL (10.576 ms) : 10389, 10764
.   : milestone, 10576,
profiling (8.381 ms) : 8250, 8512
.   : milestone, 8381,
tracing (7.543 ms) : 7437, 7650
.   : milestone, 7543,
section candidate
no_agent (4.237 ms) : 4186, 4288
.   : milestone, 4237,
iast (9.174 ms) : 9017, 9332
.   : milestone, 9174,
iast_FULL (13.267 ms) : 13008, 13526
.   : milestone, 13267,
iast_GLOBAL (9.348 ms) : 9190, 9505
.   : milestone, 9348,
profiling (7.816 ms) : 7692, 7939
.   : milestone, 7816,
tracing (7.245 ms) : 7143, 7346
.   : milestone, 7245,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.367 ms [4.318 ms, 4.416 ms] -
iast 9.645 ms [9.483 ms, 9.807 ms] 5.278 ms (120.9%)
iast_FULL 13.795 ms [13.519 ms, 14.071 ms] 9.428 ms (215.9%)
iast_GLOBAL 10.576 ms [10.389 ms, 10.764 ms] 6.21 ms (142.2%)
profiling 8.381 ms [8.25 ms, 8.512 ms] 4.014 ms (91.9%)
tracing 7.543 ms [7.437 ms, 7.65 ms] 3.176 ms (72.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.237 ms [4.186 ms, 4.288 ms] -
iast 9.174 ms [9.017 ms, 9.332 ms] 4.938 ms (116.5%)
iast_FULL 13.267 ms [13.008 ms, 13.526 ms] 9.03 ms (213.1%)
iast_GLOBAL 9.348 ms [9.19 ms, 9.505 ms] 5.111 ms (120.6%)
profiling 7.816 ms [7.692 ms, 7.939 ms] 3.579 ms (84.5%)
tracing 7.245 ms [7.143 ms, 7.346 ms] 3.008 ms (71.0%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.261 ms) : 36967, 37556
.   : milestone, 37261,
appsec (48.757 ms) : 48306, 49208
.   : milestone, 48757,
code_origins (44.92 ms) : 44548, 45292
.   : milestone, 44920,
iast (43.941 ms) : 43567, 44314
.   : milestone, 43941,
profiling (48.473 ms) : 47978, 48967
.   : milestone, 48473,
tracing (44.606 ms) : 44219, 44993
.   : milestone, 44606,
section candidate
no_agent (35.734 ms) : 35456, 36013
.   : milestone, 35734,
appsec (46.467 ms) : 46063, 46871
.   : milestone, 46467,
code_origins (44.231 ms) : 43860, 44602
.   : milestone, 44231,
iast (43.231 ms) : 42853, 43609
.   : milestone, 43231,
profiling (48.109 ms) : 47650, 48568
.   : milestone, 48109,
tracing (42.089 ms) : 41733, 42444
.   : milestone, 42089,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.261 ms [36.967 ms, 37.556 ms] -
appsec 48.757 ms [48.306 ms, 49.208 ms] 11.496 ms (30.9%)
code_origins 44.92 ms [44.548 ms, 45.292 ms] 7.659 ms (20.6%)
iast 43.941 ms [43.567 ms, 44.314 ms] 6.68 ms (17.9%)
profiling 48.473 ms [47.978 ms, 48.967 ms] 11.211 ms (30.1%)
tracing 44.606 ms [44.219 ms, 44.993 ms] 7.345 ms (19.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 35.734 ms [35.456 ms, 36.013 ms] -
appsec 46.467 ms [46.063 ms, 46.871 ms] 10.733 ms (30.0%)
code_origins 44.231 ms [43.86 ms, 44.602 ms] 8.497 ms (23.8%)
iast 43.231 ms [42.853 ms, 43.609 ms] 7.497 ms (21.0%)
profiling 48.109 ms [47.65 ms, 48.568 ms] 12.374 ms (34.6%)
tracing 42.089 ms [41.733 ms, 42.444 ms] 6.354 ms (17.8%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1755523005 1755539190
git_commit_sha e125ff7 f9bf045
release_version 1.53.0-SNAPSHOT~e125ff7b82 1.52.0-SNAPSHOT~f9bf0459de
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1755541220 1755541220
ci_job_id 1085273319 1085273319
ci_pipeline_id 74002701 74002701
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-9034tra8 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-9034tra8 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.502 s) : 15502000, 15502000
.   : milestone, 15502000,
appsec (15.079 s) : 15079000, 15079000
.   : milestone, 15079000,
iast (18.783 s) : 18783000, 18783000
.   : milestone, 18783000,
iast_GLOBAL (18.149 s) : 18149000, 18149000
.   : milestone, 18149000,
profiling (15.18 s) : 15180000, 15180000
.   : milestone, 15180000,
tracing (14.988 s) : 14988000, 14988000
.   : milestone, 14988000,
section candidate
no_agent (15.396 s) : 15396000, 15396000
.   : milestone, 15396000,
appsec (14.613 s) : 14613000, 14613000
.   : milestone, 14613000,
iast (18.975 s) : 18975000, 18975000
.   : milestone, 18975000,
iast_GLOBAL (17.915 s) : 17915000, 17915000
.   : milestone, 17915000,
profiling (15.23 s) : 15230000, 15230000
.   : milestone, 15230000,
tracing (15.081 s) : 15081000, 15081000
.   : milestone, 15081000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.502 s [15.502 s, 15.502 s] -
appsec 15.079 s [15.079 s, 15.079 s] -423.0 ms (-2.7%)
iast 18.783 s [18.783 s, 18.783 s] 3.281 s (21.2%)
iast_GLOBAL 18.149 s [18.149 s, 18.149 s] 2.647 s (17.1%)
profiling 15.18 s [15.18 s, 15.18 s] -322.0 ms (-2.1%)
tracing 14.988 s [14.988 s, 14.988 s] -514.0 ms (-3.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.396 s [15.396 s, 15.396 s] -
appsec 14.613 s [14.613 s, 14.613 s] -783.0 ms (-5.1%)
iast 18.975 s [18.975 s, 18.975 s] 3.579 s (23.2%)
iast_GLOBAL 17.915 s [17.915 s, 17.915 s] 2.519 s (16.4%)
profiling 15.23 s [15.23 s, 15.23 s] -166.0 ms (-1.1%)
tracing 15.081 s [15.081 s, 15.081 s] -315.0 ms (-2.0%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~f9bf0459de, baseline=1.53.0-SNAPSHOT~e125ff7b82
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.484 ms) : 1472, 1495
.   : milestone, 1484,
appsec (3.677 ms) : 3461, 3894
.   : milestone, 3677,
iast (2.207 ms) : 2144, 2270
.   : milestone, 2207,
iast_GLOBAL (2.252 ms) : 2189, 2315
.   : milestone, 2252,
profiling (2.486 ms) : 2271, 2701
.   : milestone, 2486,
tracing (2.017 ms) : 1968, 2065
.   : milestone, 2017,
section candidate
no_agent (1.48 ms) : 1468, 1491
.   : milestone, 1480,
appsec (3.652 ms) : 3436, 3868
.   : milestone, 3652,
iast (2.201 ms) : 2139, 2263
.   : milestone, 2201,
iast_GLOBAL (2.256 ms) : 2193, 2319
.   : milestone, 2256,
profiling (2.045 ms) : 1995, 2095
.   : milestone, 2045,
tracing (2.015 ms) : 1967, 2063
.   : milestone, 2015,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.484 ms [1.472 ms, 1.495 ms] -
appsec 3.677 ms [3.461 ms, 3.894 ms] 2.194 ms (147.9%)
iast 2.207 ms [2.144 ms, 2.27 ms] 723.566 µs (48.8%)
iast_GLOBAL 2.252 ms [2.189 ms, 2.315 ms] 768.189 µs (51.8%)
profiling 2.486 ms [2.271 ms, 2.701 ms] 1.002 ms (67.6%)
tracing 2.017 ms [1.968 ms, 2.065 ms] 533.145 µs (35.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.48 ms [1.468 ms, 1.491 ms] -
appsec 3.652 ms [3.436 ms, 3.868 ms] 2.172 ms (146.8%)
iast 2.201 ms [2.139 ms, 2.263 ms] 721.144 µs (48.7%)
iast_GLOBAL 2.256 ms [2.193 ms, 2.319 ms] 776.369 µs (52.5%)
profiling 2.045 ms [1.995 ms, 2.095 ms] 565.359 µs (38.2%)
tracing 2.015 ms [1.967 ms, 2.063 ms] 535.256 µs (36.2%)

Extract getBaseHash to be available for SQLCommenter

TBD: fix SQLCommenterTest
TBD: add DB_DBM_INJECT_SERVICE_HASH_ENABLED
@ygree ygree removed their assignment Jul 30, 2025
builder.append(processTags);
}
return FNV64Hash.generateHash(builder.toString(), FNV64Hash.Version.v1);
return ServiceHash.getBaseHash(wellKnownTags, ContainerInfo.get().getContainerTagsHash());
Copy link
Contributor Author

@ygree ygree Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this into the ServiceHash class so that it is available in the DBM instrumentation.

}
if (processTags != null) {
builder.append(processTags);
if (containerTagsHash != null && !containerTagsHash.isEmpty()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Populate the base hash with the container tag hash if the process tag propagation feature flag is.

@@ -241,6 +250,8 @@ protected static boolean toComment(
if (injectTrace) {
append(sb, TRACEPARENT, traceparent, sb.length() > emptySize);
}
// TODO only if DB_DBM_INJECT_SERVICE_HASH_ENABLED
append(sb, DD_SERVICE_HASH, serviceHash, sb.length() > emptySize);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inject the base hash into the SQL comment when the service mode is enabled.

Copy link

datadog-official bot commented Aug 13, 2025

Code coverage: total 57.31%, base diff -0.01%, patch 60.00% (view details)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f9bf045 | Docs | Was this helpful? Give us feedback!

if (sql == null || sql.isEmpty()) {
return sql;
}
if (hasDDComment(sql, appendComment)) {
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this check to after the appendComment decision is made. Otherwise, it won't work when preferAppend differs from appendComment. This can result in the comment being added twice. Tests were added to ensure this behavior is confirmed.

if (log.isDebugEnabled()) {
log.debug("exception thrown while encoding sql comment %s", e);
}
String encodedValue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the encoding first to handle a possible encoding exception properly; otherwise, it will inject a key with an unclosed quote.

if (firstWord.equalsIgnoreCase("call")) {
appendComment = true;
}

// Append the comment in the case of a pg_hint_plan extension
if (dbType.startsWith("postgres") && containsPgHint(sql)) {
if (dbType.startsWith("postgres") && sql.contains("/*+")) {
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the bug to ensure the hint is detected at the beginning. The original check was sql.indexOf("/*+") > 0. Remove containsPgHint for simplicity. Tests were added to ensure this behavior is confirmed.

if ((!(sql.endsWith(CLOSE_COMMENT)) && appendComment)
|| ((!(sql.startsWith(OPEN_COMMENT))) && !appendComment)) {
return false;
}
// else check to see if it's a DBM trace sql comment
int startIdx = 2;
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the magic constant 2.

}
int startComment = appendComment ? startIdx : sql.length();
boolean found = false;
if (startComment > 2) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is useless because it's never true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: data streams Data Streams Monitoring comp: database Database Monitoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant